package com.qf.controller;

import com.qf.service.DtsFootprintServicce;
import com.qf.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**  用户管理  会员足迹
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.qf.controller
 * @Description:
 * @Date 2022/10/16 20:58
 */
@RestController
@RequestMapping("/admin/footprint")
public class AdminFootprintController {

    @Autowired
    DtsFootprintServicce footprintServicce;

//    /admin/footprint/list?page=1&limit=20&userId=12&goodsId=123&sort=add_time&order=desc
    @GetMapping("/list")
    public Object list(@RequestParam(value = "page",required = false, defaultValue = "1") Integer page,
                       @RequestParam(value = "limit",required = false, defaultValue = "20")Integer limit,
                       @RequestParam(value = "sort",required = false, defaultValue = "add_time")String sort,
                       @RequestParam(value = "order",required = false, defaultValue = "desc")String order,
                       Integer goodsId, Integer userId){

        Map<String, Object> data = footprintServicce.selectByPage(page,limit,sort,order,goodsId,userId);

        return ResponseUtil.ok(data);
    }

}
